<form id="userForm" lay-filter="userForm" class="layui-form model-form">
  <div class="layui-form-item">
    <label class="layui-form-label">账号<span style="color: red;">*</span></label>
    <div class="layui-input-block">
      <input name="account" placeholder="请输入账号" value="" type="text" class="layui-input" lay-verify="required" required/>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">昵称<span style="color: red;">*</span></label>
    <div class="layui-input-block">
      <input name="nickname" placeholder="请输入昵称" value="" type="text" class="layui-input" lay-verify="required" required/>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">邮箱<span style="color: red;">*</span></label>
    <div class="layui-input-block">
      <input name="email" placeholder="请输入邮箱" value="" type="text" class="layui-input" lay-verify="required|email" required/>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">电话</label>
    <div class="layui-input-block">
      <input name="mobile" placeholder="请输入电话" value="" type="text" class="layui-input" autocomplete="off"/>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-block">
      <select id="sex" name="sex" lay-verify="sex">
        <option value="1">男</option>
        <option value="0">女</option>
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-block">
      <select id="status" name="status" lay-verify="sex">
        <option value="1">启用</option>
        <option value="0">禁用</option>
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">角色<span style="color: red;">*</span></label>
    <div class="layui-input-block">
      <!-- 这里的xm-select属性是多选的ID, 如多处使用请保证全局唯一 -->
      <select name="roleIds" xm-select="roleIdsSelect">
        {foreach $rolelist as $key=>$vo }
        <option value="{$vo.id}">{$vo.title}</option>
        {/foreach}
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block">
      <input name="remark" placeholder="请输入备注" value="" type="text" class="layui-input"/>
    </div>
  </div>
</form>
<script>
    layui.formSelects.render('roleIdsSelect');
    layui.form.render();
</script>
